package de.pyranja.money.core;

import java.math.BigDecimal;
import java.util.Currency;

import de.pyranja.money.Money;
import de.pyranja.money.MoneyCalculator;

/**
 * Fluid builder for Money instances.
 * 
 * @author Chris Borckholder
 */
public class MoneyBuilder {
	
	private BigDecimal amount;
	private Currency currency;
	private MoneyCalculator calculator;
	
	public MoneyBuilder(BigDecimal amount, Currency currency,
			MoneyCalculator calculator) {
		super();
		this.amount = amount;
		this.currency = currency;
		this.calculator = calculator;
	}
	
	public MoneyBuilder in(Currency currency) {
		this.currency = currency;
		return this;
	}
	
	public Money build() {
		return new Money(amount,currency,calculator);
	}
}